//
//  TCLYTwoIntegralCollectionViewCell.m
//  YuErmuYing
//
//  Created by LYang on 16/9/2.
//  Copyright © 2016年 Tiancheng. All rights reserved.
//

#import "TCLYTwoIntegralCollectionViewCell.h"
#import "Macros.h"
#import "Masonry.h"

@implementation TCLYTwoIntegralCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.nameLabel = [[UILabel alloc] init];
        self.nameLabel.textColor = blackFont;
        self.nameLabel.textAlignment = NSTextAlignmentCenter;
        self.nameLabel.font = [UIFont systemFontOfSize:12];
        [self addSubview:self.nameLabel];
        [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(10);
            make.left.mas_equalTo(self);
            make.right.mas_equalTo(self);
            make.height.mas_equalTo(20);
        }];
        
        self.introduceLabel = [[UILabel alloc] init];
        self.introduceLabel.textColor = grayFont;
        self.introduceLabel.textAlignment = NSTextAlignmentCenter;
        self.introduceLabel.font = [UIFont systemFontOfSize:12];
        [self addSubview:self.introduceLabel];
        [self.introduceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.nameLabel.mas_bottom);
            make.left.mas_equalTo(self.nameLabel);
            make.right.mas_equalTo(self.nameLabel);
            make.height.mas_equalTo(20);
        }];
        
        self.goodsImageView = [[UIImageView alloc] init];
        [self addSubview:self.goodsImageView];
        [self.goodsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.introduceLabel.mas_bottom);
            make.left.mas_equalTo(self.introduceLabel.mas_left).offset(12);
            make.right.mas_equalTo(self.introduceLabel.mas_right).offset(-12);
            make.bottom.mas_equalTo(-10);
        }];
    }
    return self;
}
@end
